﻿Public Class FrmCategory

    Private Sub FrmCategory_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Public Sub LoadData()
        'Dim x = "SELECT C.*, T.TypeName FROM tbl_Category C INNER JOIN tbl_Type T ON T.type_id=C.type_id WHERE (C.cat_name LIKE N'%" & txtSearch.Text & "%' OR T.type_name LIKE N'%" & txtSearch.Text & "%') AND C.Active=1"
        'If (cboCategory.SelectedValue <> 0) Then
        '    x = x & " AND T.TypeId=" & cboCategory.SelectedValue
        'End If
        'Me.dgvCategory.DataSource = Cmd.ExecuteDataTable(x)
    End Sub

    Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsert.Click
        Dim frm As New FrmCategoryEditor
        frm.cboCategoryType.SelectedValue = cboCategory.SelectedValue
        If frm.ShowDialog = Windows.Forms.DialogResult.OK Then
            LoadData()
        End If
    End Sub
End Class
